<layout name="layout" />
<div class="row">
<div id="content" class="col-md-12">
	<ul class="nav nav-tabs" id="myTab">
	  <li class="active"><a href="#groupList" data-toggle="tab">用户列表</a></li>
	  <li class=""><a href="#groupAdd" data-toggle="tab">添加用户</a></li>
	</ul>
<?php //var_dump($users); ?>
	<!-- Tab panes -->
	<div class="tab-content">
  		<div class="tab-pane fade active in" id="groupList">
			<table class="table table-striped table-bordered table-hover">
				<thead>
					<tr>
						<th>序号</th>
						<th>用户名</th>
						<th>邮箱</th>
						<th>所属组</th>
						<th>积分</th>
						<th>上次登陆</th>
						<th>登陆IP</th>
						<th>状态</th>
						<th>操作</th>
					</tr>						
				</thead>	
				<tbody>
				<foreach name="users" item="v">
				<tr>
					<td>{$v.id}</td>
					<td>{$v.username}</td>
					<td>{$v.email}</td>
					<td>{$v.title}</td>
					<td>{$v.score}</td>
					<td>{$v.logintime|date='Y-m-d H:i:s',###}</td>
					<td>{$v.loginip}</td>
					<td>
						<if condition="$v.status eq 1">
							<span class="label label-success">正常</span>
						<else/>
							<span class="label label-danger">禁用</span>
						</if>
					</td>
					<td>
						<div class="btn-group btn-group-xs">
							<a href="__CONTROLLER__/editUser?id={$v.id}" class="btn btn-warning" style="margin-left:5px;">修改</a>
							<a href="__CONTROLLER__/delUser?id={$v.id}" class="btn btn-danger" style="margin-left:5px;">删除</a>
						</div>
					</td>
				</tr>
				</foreach>
			</tbody>
			</table>
			<ul class="pagination">{$page}</ul>
		
	  </div>
	  <div class="tab-pane fade" id="groupAdd">
			<form class="form-horizontal" action="__CONTROLLER__/addUser" method="post">
				<div class="form-group">
					<label for="title" class="col-sm-2 control-label">用户名:</label>
					<div class="col-sm-5">
						<input type="text" class="form-control" placeholder="请输入用户名(必填)" name="username" id="ruleTitle">
					</div>
					<label class="col-sm-2 control-label"></label>
				</div>						

				<div class="form-group">
					<label for="name" class="col-sm-2 control-label">邮箱:</label>
					<div class="col-sm-5">
						<input type="text" class="form-control" placeholder="请输入邮箱(必填)" name="email" id="ruleName">
					</div>
					<label class="col-sm-2 control-label"></label>
				</div>

				<div class="form-group">
					<label for="condition" class="col-sm-2 control-label">密码:</label>
					<div class="col-sm-5">
						<input type="password" class="form-control" placeholder="请输入密码" name="password" id="condition">
					</div>
					<label class="col-sm-2 control-label"></label>
				</div>
				<div class="form-group">
					<label for="condition" class="col-sm-2 control-label">重复密码:</label>
					<div class="col-sm-5">
						<input type="password" class="form-control" placeholder="请再次输入密码" name="password" id="condition">
					</div>
					<label class="col-sm-2 control-label"></label>
				</div>
				<div class="form-group">
					<label for="name" class="col-sm-2 control-label">积分:</label>
					<div class="col-sm-5">
						<input type="text" class="form-control" placeholder="请输入默认积分(选填)" name="score" id="ruleName">
					</div>
					<label class="col-sm-2 control-label"></label>
				</div>
				<div class="form-group">
					<label for="modules" class="col-sm-2 control-label">所属组:</label>
					<div class="col-sm-3">
						<select class="form-control" name="group_id">
							<option vaule="">---请选择用户组---</option>
							<foreach name="group" item="v">
								<option value="{$v.id}">{$v.title}</option>
							</foreach>
						</select>
					</div>
					<label class="col-sm-2 control-label"></label>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">是否启用:</label>
					<div class="btn-group col-sm-5" data-toggle="buttons">
						<label class="btn btn-primary">
							<input type="radio" name="status" id="status" checked="checked" value="1">启用
						</label>

						<label class="btn btn-danger">
							<input type="radio" name="status" id="status" value="0">禁用
						</label>
					</div>
					<label class="col-sm-2 control-label"></label>
				</div>

	

				<div class="form-group">
					<label class="col-sm-2 control-label"></label>
					<div class="col-sm-5">
						<button type="submit" class="btn btn-success btn-add">添加</button>
					</div>
					
				</div>

			</form>
	  </div>
	</div>
</div>
</div>